package com.jinsi.controller.yrf;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jinsi.constant.YrfConstant;
import com.jinsi.pojo.SySealLog;
import com.jinsi.service.yrf.SealLogService;
import com.jinsi.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

/**
 * @author: 86185
 * @description: 封号日志
 * @date 2022/9/9
 */
@RestController
@RequestMapping("/sealLog")
public class SealLogController {

    @Autowired
    private SealLogService sealLogService;

    /**
     * 获取所有数据
     * @param sySealLog 模糊查
     * @return 前端需要的类型
     */
    @RequestMapping("/getAll")
    public R getAll(Integer page, Integer limit, SySealLog sySealLog){

        PageHelper.startPage(page,limit);
        List<SySealLog> all = sealLogService.getAll(sySealLog);
        PageInfo<SySealLog> pageInfo = new PageInfo<>(all);

        return R.custom(YrfConstant.LAYUI_CODE,
                YrfConstant.LAYUI_MSG,
                pageInfo.getList(),
                pageInfo.getTotal());

    }

}
